notebook: inform the theme whether show-borders was set
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Wed, 16 Oct 2013 16:03:33 +0000 (12:03 -0400)
committerWilliam Jon McCann <william.jon.mccann@gmail.com>
Wed, 16 Oct 2013 16:03:33 +0000 (12:03 -0400)
So that it can draw a border or not. If show-borders=true then
the notebook will have GTK_STYLE_CLASS_FRAME.

gtk/gtknotebook.c

index f958d8229b7829c9773ddd30a0882b0cf7c36901..2b0f914362610ab88ab064c74bd594ff8d2deeb0 100644 (file)
@@ -5189,10 +5189,14 @@ gtk_notebook_paint (GtkWidget    *widget,
 
   if (priv->show_border && (!priv->show_tabs || !priv->children))
     {
+      gtk_style_context_save (context);
+      gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
+
       gtk_render_background (context, cr,
                              x, y, width, height);
       gtk_render_frame (context, cr,
                         x, y, width, height);
+      gtk_style_context_restore (context);
       return;
     }
 
@@ -5332,6 +5336,9 @@ gtk_notebook_paint (GtkWidget    *widget,
                         "has-tab-gap", &has_tab_gap,
                         NULL);
 
+  if (priv->show_border)
+    gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
+
   gtk_render_background (context, cr,
                          x, y, width, height);
   if (has_tab_gap)